package com.myx.typhoon.common.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**  
 * @author myx
 * @createTime 2016年2月4日 下午5:11:35  
 * 
 */
public class RegexUtil {
	
	public static boolean checkMail(String mail) {
		String regex = "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
		Pattern compile = Pattern.compile(regex);
		Matcher matcher = compile.matcher(mail);
		return matcher.matches();
	}
}
